
import numpy as np
import cv2 as cv

# 创建8*8照片
img = np.zeros((8,8,3),np.uint8)
cv.line(img, (0,0), (0,7), (255,0,0), 1)    # 画直线, 做翻转标记
cv.line(img, (0,0), (7,0), (0,255,0), 1)    # 画直线, 做翻转标记
cv.imshow('1_orgin_img',img)
# cv.waitKey(0)

# 水平翻转
hflip_img = cv.flip(img, 1)
cv.imshow('2_hflip_img',hflip_img)
# cv.waitKey(0)

# 垂直翻转
vflip_img = cv.flip(img, 0)
cv.imshow('3_vflip_img',vflip_img)
# cv.waitKey(0)

# 水平+垂直翻转
hvflip_img = cv.flip(img, -1)
cv.imshow('4_hvflip_img',hvflip_img)
cv.waitKey(0)

cv.destroyAllWindows()